<?php
declare (strict_types = 1);

namespace app\common\model;

class Course extends Base
{

    protected $name = 'course';

    public function getCateTextAttr($value, $data)
    {
        $info = Cate::where('id', $data['cate'])->find();
        if(empty($info)){
            return '';
        }
        $cate = Cate::where('id', $info['pid'])->value('title');
        return $cate.'-'.Cate::where('id', $data['cate'])->value('title')??"";
    }
}
